<?php 
include("connection/connection.php");
session_start();
$loginid=$_SESSION['loginid'];
//$time_offset ="525"; // Change this to your time zone
    //$time_a = ($time_offset * 120);
   // $last_login = date("D M j G:i:s T Y",time() + $time_a);//date("D dS M,Y h:i a");
    //echo 'Current time is : '.$last_login;
	$dateTime = new DateTime("now");
 
$dateTimeZone = new DateTimeZone('Asia/Kolkata');
$dateTime->setTimezone($dateTimeZone);
 
$datet=$dateTime->format("Y-m-d H:i:s");
	$query="UPDATE tbl_dtls_login_info_new SET logoff_time='$datet' WHERE id='".$_SESSION['id']."'";
	$result=mysql_query($query);
session_destroy();
?>
<?php
if(isset($_COOKIE[loginid]))
{
	setcookie('user','',time()-3);
	header('location:../index.php');
	
}
else
{
	header('location:../index.php');
	
}

?>
